/*================================================================
*   Copyright (C) 2023 Sangfor Ltd. All rights reserved.
*   
*   文件名称：radixmap.h
*   创 建 者：szmoto, szmoto@vip.qq.com
*   创建日期：2023年08月22日
*   描    述：
*
================================================================*/

#ifndef _radixmap_h
#include <stdint.h>
typedef union RMElement {
    uint64_t raw;
    struct {
        uint32_t key;
        uint32_t value;
    } data;
} RMElement;
typedef struct RadixMap {
    size_t max;
    size_t end;
    uint32_t counter;
    RMElement *contents;
    RMElement *temp;
} RadixMap;
RadixMap *RadixMap_create(size_t max);
void RadixMap_destroy(RadixMap *map);
void RadixMap_sort(RadixMap *map);
RMElement *RadixMap_find(RadixMap *map, uint32_t key);
int RadixMap_add(RadixMap *map, uint32_t key, uint32_t value);
int RadixMap_delete(RadixMap *map, RMElement *el);
#endif
